#!/bin/sh
export CALLDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
. "${CALLDIR}/SetEnv.sh"
cd ${CALLDIR}
function pause(){
   read -p "$*"
}
echo ==================================
echo =          Send Mail             =
echo =       by Otto Abreu            =
echo ==================================
echo
echo
echo "work directory: ${CALLDIR}"
echo "library directory: ${LIBDIR}"
CLASSPATH=${CLASSPATH}${CP_SENDMAIL}
echo "Classpath:"
echo
echo
echo
echo ${CLASSPATH}
echo
echo
echo
echo
ARGS=""
while [ -n "$1" ]
  do
    ARGS="${ARGS} $1"
    shift
done
java -cp ${CLASSPATH} com.google.code.ojar.sendtemplatemail.console.exec.SendMailMain ${ARGS}
echo  RETURNS: $?
pause 'Press [Enter] key to continue...'